package routers

import (
	"gin-project-01/gin-step04/gin15-gorm-advance/controllers/nav"
	"gin-project-01/gin-step04/gin15-gorm-advance/middlewares"
	"github.com/gin-gonic/gin"
)

func NavRouters(r *gin.Engine) {
	//路由分组中间件使用方式二
	routers := r.Group("/nav")
	routers.Use(middlewares.SaveAccessLog)
	{

		routers.GET("/", nav.NavController{}.Index)

		routers.GET("/get/:id", nav.NavController{}.GetById)

		//条件查询
		routers.GET("/get", nav.NavController{}.Select)

		//原生SQL
		routers.GET("/raw", nav.NavController{}.Raw)

	}
}
